GTK_PARAM_READWRITE);
image_props[PROP_ICON_SIZE] =
- g_param_spec_int ("icon-size",
- P_("Icon size"),
- P_("Symbolic size to use for icon set or named icon"),
- 0, G_MAXINT,
- GTK_ICON_SIZE_INHERIT,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+ g_param_spec_enum ("icon-size",
+ P_("Icon size"),
+ P_("Symbolic size to use for icon set or named icon"),
+ GTK_TYPE_ICON_SIZE,
+ GTK_ICON_SIZE_INHERIT,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkImage:pixel-size:
gtk_image_set_from_file (image, g_value_get_string (value));
break;
case PROP_ICON_SIZE:
- gtk_image_set_icon_size (image, g_value_get_int (value));
+ gtk_image_set_icon_size (image, g_value_get_enum (value));
break;
case PROP_PIXEL_SIZE:
gtk_image_set_pixel_size (image, g_value_get_int (value));
g_value_set_string (value, priv->filename);
break;
case PROP_ICON_SIZE:
- g_value_set_int (value, priv->icon_size);
+ g_value_set_enum (value, priv->icon_size);
break;
case PROP_PIXEL_SIZE:
g_value_set_int (value, _gtk_icon_helper_get_pixel_size (&priv->icon_helper));
* If the icon name isn’t known, a “broken image” icon will be
* displayed instead. If the current icon theme is changed, the icon
* will be updated appropriately.
- *
+ *
+ * Note: Before 3.94, this function was taking an extra icon size
+ * argument. See gtk_image_set_icon_size() for another way to set
+ * the icon size.
+ *
* Returns: a new #GtkImage displaying the themed icon
*
* Since: 2.6
* If the icon name isn’t known, a “broken image” icon will be
* displayed instead. If the current icon theme is changed, the icon
* will be updated appropriately.
- *
+ *
+ * Note: Before 3.94, this function was taking an extra icon size
+ * argument. See gtk_image_set_icon_size() for another way to set
+ * the icon size.
+ *
* Returns: a new #GtkImage displaying the themed icon
*
* Since: 2.14
*
* See gtk_image_new_from_icon_name() for details.
*
+ * Note: Before 3.94, this function was taking an extra icon size
+ * argument. See gtk_image_set_icon_size() for another way to set
+ * the icon size.
+ *
* Since: 2.6
**/
void
*
* See gtk_image_new_from_gicon() for details.
*
+ * Note: Before 3.94, this function was taking an extra icon size
+ * argument. See gtk_image_set_icon_size() for another way to set
+ * the icon size.
+ *
* Since: 2.14
**/
void
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkwidgetprivate.h"
+#include "gtktypebuiltins.h"
/**
* SECTION:gtkstackswitcher
{
GtkStack *stack;
GHashTable *buttons;
- gint icon_size;
+ GtkIconSize icon_size;
gboolean in_child_changed;
GtkWidget *switch_button;
guint switch_timer;
static void
gtk_stack_switcher_set_icon_size (GtkStackSwitcher *switcher,
- gint icon_size)
+ GtkIconSize icon_size)
{
GtkStackSwitcherPrivate *priv;
switch (prop_id)
{
case PROP_ICON_SIZE:
- g_value_set_int (value, priv->icon_size);
+ g_value_set_enum (value, priv->icon_size);
break;
case PROP_STACK:
switch (prop_id)
{
case PROP_ICON_SIZE:
- gtk_stack_switcher_set_icon_size (switcher, g_value_get_int (value));
+ gtk_stack_switcher_set_icon_size (switcher, g_value_get_enum (value));
break;
case PROP_STACK:
*/
g_object_class_install_property (object_class,
PROP_ICON_SIZE,
- g_param_spec_int ("icon-size",
- P_("Icon Size"),
- P_("Symbolic size to use for named icon"),
- 0, G_MAXINT,
- GTK_ICON_SIZE_INHERIT,
- G_PARAM_EXPLICIT_NOTIFY | GTK_PARAM_READWRITE));
+ g_param_spec_enum ("icon-size",
+ P_("Icon Size"),
+ P_("Symbolic size to use for named icon"),
+ GTK_TYPE_ICON_SIZE,
+ GTK_ICON_SIZE_INHERIT,
+ G_PARAM_EXPLICIT_NOTIFY | GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_STACK,